package peerToPeerFacebook.proj;

/**
 * Implements IFacebookCommand
 */
public class FacebookCommand implements IFacebookCommand 
{
	private String commandName;
	
	// DEVNOTE: abhip
	// can contain either userName or friendName depending on command
	// eg, for login command, it will store userName
	// eg, for send friend request command, it will store friendName to whom the request needs to be sent
	// This is slightly hacky, but there were architectural reasons to do so 
	private String userNameOrFriendName;
	
	private String message;
	
	public FacebookCommand(String commandName)
	{
		// call the main constructor with default values for rest of parameters
		this(commandName, null, null);
	}
	
	public FacebookCommand(String commandName, String userNameOrFriendName)
	{	
		// call the main constructor with default values for rest of parameters
		this(commandName, userNameOrFriendName, null);	
	}	

	public FacebookCommand(String commandName, String userNameOrFriendName, String message)
	{
		// commandName cannot be null, rest can be depending on the command
		// eg, logout command will only have commandName, rest null
		ArgumentValidator.IsNotNullOrEmpty("commandName", commandName);
		
		this.commandName = commandName;
		this.userNameOrFriendName = userNameOrFriendName;
		this.message = message;
	}						
	
	public String commandName()
	{
		return commandName;
	}
	
	public String userNameOrFriendName()
	{
		return userNameOrFriendName;
	}
	
	public String message()
	{
		return message;
	}
}
